package com.eshop.logging.tools.job;

import java.util.Date;
import org.springframework.scheduling.annotation.Scheduled;
import de.schlichtherle.license.LicenseManager;
import de.schlichtherle.license.LicenseParam;
import com.zhonghui.license.LicenseManagerHolder;
import com.zhonghui.license.LicenseVerify;

public class Jobs
{
    @Scheduled(fixedRate = 3000L)
    public void fixedRateJob() throws Exception {
        final LicenseVerify licenseVerify = new LicenseVerify();
        final boolean verifyResult = licenseVerify.verify();
        final LicenseManager licenseManager = LicenseManagerHolder.getInstance((LicenseParam)null);
        if (!verifyResult) {
            licenseManager.uninstall();
        }
    }
    
    @Scheduled(cron = "0 0,30 0,8 ? * ? ")
    public void cronJob() {
        System.out.println(new Date() + " ...>>cron....");
    }
}
